package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.bean.RoleBean;
import com.project.bean.UserBean;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface IUserMapper extends BaseMapper<UserBean> {
    /**
     * 批量添加用户角色中间表
     * @param userId 用户id
     * @param roleIdArray 角色数组
     */
    void addRoleList(@Param("userId") Integer userId, @Param("roleIdArray") Integer[] roleIdArray);

    @Delete("delete from t_user_role where fk_userId=#{userId}")
    void del(Integer userId);

}
